const std = @import("std");

const fprint = @import("lib/user.zig").fprint;
const sys = @import("lib/syscall.zig");

export fn main(argc: usize, argv: [*:null]const ?sys.c_str) noreturn {
    if (argc < 2) {
        fprint(2, "Usage: sleep <secs>\n", .{});
        sys.exit(1);
    }

    _ = sys.pause(std.fmt.parseInt(usize, std.mem.sliceTo(argv[1].?, 0), 0) catch |err| {
        fprint(2, "{t}\n", .{err});
        sys.exit(1);
    });

    sys.exit(0);
}
